<!doctype html>
<html>
<head>
    <meta charset="UTF-8" />
    <title>全部订单</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/Wx/css/base.css" />
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/Wx/css/index.css" />
</head>
<body>
<div class="order">
    <div class="tabber tabber02">
        <span onClick="window.location='__MODULE__/UserExchangeorder/index/'" <eq name="state" value="">class="on"</eq>>全部</span>
        <span onClick="window.location='__MODULE__/UserExchangeorder/index/state/0/'" <eq name="state" value="0">class="on"</eq>>待付款</span>
        <span onClick="window.location='__MODULE__/UserExchangeorder/index/state/1/'" <eq name="state" value="1">class="on"</eq>>待核销</span>
        <span onClick="window.location='__MODULE__/UserExchangeorder/index/state/2/'" <eq name="state" value="2">class="on"</eq>>已核销</span>
        <span onClick="window.location='__MODULE__/UserExchangeorder/index/state/3/'" <eq name="state" value="3">class="on"</eq>>已评价</span>
    </div>
    <div class="orderlist">
        <div class="block">
            <ul>
                <volist name="order" id="vo">
                    <li>
                        <div class="tit">订单状态<span>
                    <eq name="vo.state" value="0">等待买家付款</eq>
                    <eq name="vo.state" value="1">待核销</eq>
                    <eq name="vo.state" value="2">已核销</eq>
                    <eq name="vo.state" value="3">已评价</eq>
                    </span></div>
                        <div class="pro" onClick="window.location='__MODULE__/UserExchangeorder/detail/oid/{$vo.id}'">
                            <div class="pic"><img src="{$vo.f_img}"/></div>
                            <div class="name">
                                <h2><eq name="vo.g_u_id" value="0"><b class="pp">品牌</b><else/><b class="md">门店</b></eq>{$vo.title}</h2>

                                <h6 style="color:#666;">市场参考价：{$vo.price}元</h6>
                                <!--<h3 style="height:20px; line-height:20px;"><em style="font-size:14px;">
                                <if condition="$vo['total_fee'] gt 0 ">{$vo['total_fee']}元</if><if condition=" $vo['card_fee'] gt 0 ">{$vo['card_fee']}元</if><if condition="($vo['total_fee'] gt 0 or $vo['card_fee'] gt 0) and $vo['level_integral'] gt 0">+</if><if condition="$vo['level_integral'] gt 0">{$vo['level_integral']}积分</if>
                                </em><b class="sl" style="padding-top:0;">X1</b></h3>-->
                            </div>
                        </div>
                        <div class="total"><span>合计：<i>
                    <if condition="$vo['total_fee'] gt 0 ">{$vo['total_fee']}元</if><if condition=" $vo['card_fee'] gt 0 ">{$vo['card_fee']}元</if><if condition="($vo['total_fee'] gt 0 or $vo['card_fee'] gt 0) and $vo['level_integral'] gt 0">+</if><if condition="$vo['level_integral'] gt 0">{$vo['level_integral']}积分</if>
                    </i></span></div>
                        <eq name="vo.state" value="0"><div class="button">
                            <input type="button" class="delete del" order_id="{$vo.id}" goods_id="{$vo.g_id}" value="取消订单" style="background:#fff; border:1px #666666 solid; margin-right:10px; color:#666;"/>
                            <input type="button" value="立即付款" onClick="window.location='__MODULE__/UserExchangeorder/detail/oid/{$vo.id}'"/></div></eq>
                        <eq name="vo.state" value="1"><div class="button">
                            <input type="button" value="查看订单" onClick="window.location='__MODULE__/UserExchangeorder/detail/oid/{$vo.id}'"/></div></eq>
                        <eq name="vo.state" value="2"><div class="button">
                            <input type="button" value="发表评价" onClick="window.location='__MODULE__/UserExchangeorder/detail/oid/{$vo.id}'"/></div></eq>
                        <eq name="vo.state" value="3"><div class="button">
                            <input type="button" class="delete" value="查看评价" style="background:#fff; border:1px #666666 solid;color:#666;"onClick="window.location='__MODULE__/UserExchangeorder/detail/oid/{$vo.id}'"/></div></eq>

                    </li>
                </volist>

            </ul>
        </div>

    </div>
    <!--<div class="notes">
        <div class="inner">
            <h2><img src="__PUBLIC__/Wx/img/success03.png"/></h2>
            <h3>取消成功！</h3>
        </div>
    </div>-->
</div>
<!--引用悬浮公共导航文件-->
<include file="Public:nav" />
<script type="text/javascript" src="__PUBLIC__/Wx/js/jquery-1.9.1.js"></script>
<script type="text/javascript">

    $(".click span").click(function(){
        if($(this).text() ==="导航"){
            $(this).text("收起");
            $('.link02').css('display','block')
        }else{
            $(this).text("导航");
            $('.link02').css('display','none')
        }//end if
    });//end fun


    $('.tabber span').click(function(){
        $(this).addClass("on").siblings().removeClass();
        $(".orderlist>.block").hide().eq($('.tabber span').index(this)).show();
    });
    // $(document).ready(
    //     function()
    //     {
    //         $('.notes').delay(3000).hide(0);
    //     }
    // );
</script>
<script type="text/javascript">
    $('.del').click(function(){
        var dele = $(this);
        var order_id = dele.attr('order_id');
        var goods_id = dele.attr('goods_id');
        $.post('<?=U("UserExchangeorder/cancel")?>',{'goods_id':goods_id,'order_id':order_id},function (data) {
            if(!data){
                dele.parents("li").remove();
            }else{
                console.log(data);
            }
        })
    });

</script>

</body>
</html>